package com.linkgie.galaxyframework.log;

/**
 * 应用日志；
 * <p>
 * 
 * @author huanghaiquan
 *
 */
public interface ApplicationLogger {

	default void trace(String message, Execution execution) {
		trace(message, execution, null);
	}

	default void trace(String message, Execution execution, Audition audition) {
		log(message, LogLevel.TRACE, execution, audition, null);
	}

	default void debug(String message, Execution execution) {
		debug(message, execution, null);
	}

	default void debug(String message, Execution execution, Audition audition) {
		log(message, LogLevel.DEBUG, execution, audition, null);
	}

	default void info(String message, Execution execution) {
		info(message, execution, null);
	}

	default void info(String message, Execution execution, Audition audition) {
		log(message, LogLevel.INFO, execution, audition, null);
	}

	default void warn(String message, Execution execution) {
		warn(message, execution, null, null);
	}

	default void warn(String message, Execution execution, Throwable error) {
		warn(message, execution, null, error);
	}

	default void warn(String message, Execution execution, Audition audition) {
		log(message, LogLevel.WARN, execution, audition, null);
	}

	default void warn(String message, Execution execution, Audition audition, Throwable error) {
		log(message, LogLevel.WARN, execution, audition, error);
	}

	default void error(String message, Execution execution) {
		log(message, LogLevel.ERROR, execution, null, null);
	}

	default void error(String message, Execution execution, Throwable error) {
		log(message, LogLevel.ERROR, execution, null, error);
	}

	default void error(String message, Execution execution, Audition audition) {
		log(message, LogLevel.ERROR, execution, audition, null);
	}

	default void error(String message, Execution execution, Audition audition, Throwable error) {
		log(message, LogLevel.ERROR, execution, audition, error);
	}

//	default void log(String message, LogLevel level, Execution execution) {
//		log(message, level, execution, null);
//	}
//
//	default void log(String message, LogLevel level, Execution execution, Audition audition) {
//		log(message, level, execution, audition, null);
//	}

	void log(String message, LogLevel level, Execution execution, Audition audition, Throwable error);

}
